//
//  ReadOneImageCell.m
//  News
//
//  Created by lanou3g on 15/11/11.
//  Copyright © 2015年 songhaowen. All rights reserved.
//

#import "ReadOneImageCell.h"
#import "UIImageView+WebCache.h"
#import "ReadModel.h"

@interface ReadOneImageCell ()

@property (weak, nonatomic) IBOutlet UIImageView *pictureImage;
@property (weak, nonatomic) IBOutlet UILabel *sourceLabel;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *bottomView;

@property (weak, nonatomic) IBOutlet UIButton *favorateBtn;


@end

@implementation ReadOneImageCell

#pragma mark - 初始化cell
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cell_readOne = @"cell_readOne";
    ReadOneImageCell *cell = [tableView dequeueReusableCellWithIdentifier:cell_readOne];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"ReadOneImageCell" owner:nil options:nil] lastObject];
        cell.backgroundColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.5];
        cell.bottomView.layer.cornerRadius = 20;
        cell.bottomView.layer.masksToBounds = YES;
        
    }
    return cell;
    
    
}

- (void)setModel:(ReadModel *)model
{
    _model = model;
    
    [self.pictureImage sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"shw_zhanwei"]];
    self.pictureImage.contentMode = UIViewContentModeScaleAspectFill;
    self.pictureImage.layer.masksToBounds = YES;
    
    self.sourceLabel.text = model.source;
    self.sourceLabel.font = [UIFont systemFontOfSize:14];
    self.sourceLabel.textColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.8];
    
    self.titleLabel.text = model.title;
    
}





@end
